package xyz.zhengtank.helloworld;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@RestController
public class HelloWorldApplication {

	@GetMapping("say_hi_to")
	public String sayHelloTo(@RequestParam("name") String name) {
		return "hello, " + name;
	}

	@GetMapping("upper")
	public String changeIntoUpperCase(@RequestParam("word") String word) {
		return word.toUpperCase();
	}

	@GetMapping("/")
	public String hello() {
		return "hello, welcome";
	}
	public static void main(String[] args) {
		SpringApplication.run(HelloWorldApplication.class, args);
	}

}
